# CMakeLists.txt

# 设置 CMake 的最低版本要求
cmake_minimum_required(VERSION 3.10)

# 项目名称
project(Low_Mach LANGUAGES CXX)

# 设置编译器及其选项
set(CMAKE_CXX_COMPILER g++)
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wno-deprecated-declarations")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 查找 Eigen 库
find_package(Eigen3 3.3 REQUIRED NO_MODULE)

# 包含 Eigen 库的头文件路径
include_directories(${EIGEN3_INCLUDE_DIR})

# 定义源文件和头文件
set(SRCS
    Param.cxx
    Mesh.cxx
    ThermoLaw.cxx
    Sol_Isentropic.cxx
    Solver_Isentropic.cxx
    main.cxx
)

set(HEADERS
    Param.h
    Mesh.h
    ThermoLaw.h
    Sol_Isentropic.h
    Solver_Isentropic.h
)

# 添加可执行文件
add_executable(Simulation ${SRCS})

# 链接 Eigen 库
target_link_libraries(Simulation Eigen3::Eigen)

# 设置输出目录
set(OUTPUT_DIR "./Output")

# 定义清理规则
#add_custom_target(clean
#    COMMAND ${CMAKE_COMMAND} -P clean.cmake
 #   COMMAND ${CMAKE_COMMAND} -E remove *.exe *.o *.vtk *.dat *_TIME *.swp .*swn .*.swp
#    COMMAND find ${OUTPUT_DIR} -name "*" -print0 | xargs -0 rm
#)
